﻿@model dynamic

@{
    ViewBag.Title = "账户设置";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section css
{
    <link href="@(ViewBag.RootNode)/Assets/css/PagerStyle.css" rel="stylesheet" type="text/css">
}

<div class="widget widget-body">
    <div class="panel panel-default">
        <form class="panel-body" action="" id="form1">
            <div class="form-inline control-left">
                <label>
                    名称：
                    <input type="text" v-model="model.Name" name="name"
                           id="label" placeholder="名称"
                           class="form-control input-sm" style="min-width: 150px; width: 155px;">
                </label>
                <label>
                    状态：
                    <select class="form-control input-sm" style="min-width: 130px"
                            name="spendType" v-model="model.IsValid">
                        <option v-for="item in contentTypeNum" v-bind:value="item.id">
                            {{item.name}}
                        </option>
                    </select>
                </label>
                <button type="button" onclick="LoadingActivityResultDetailDate();"
                        class="btn btn-success" title="查询" value="查询">
                    查询<i class="fa fa-search"></i>
                </button>
                <button type="button" onclick="newContent(0);" class="btn btn-success" title="新增" value="新增">新增<i class="fa fa-plus"></i></button>
                <button type="button" onclick="initCostChannelInfo();" class="btn btn-info" title="初始化" value="初始化">初始化<i class="fa  fa-caret-right"></i></button>
            </div>
        </form>
    </div>
    <div id="resultTable">
        <table class="table table-bordered  table-hover ">
            <thead class="flip-content bordered-palegreen">
                <tr class="control-center">
                    <th>Id</th>
                    <th>账户名</th>
                    <th>账号</th>
                    <th>排序值</th>
                    <th>状态</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr class="control-center" v-for="item of dataList">
                    <td>{{item.Id}}</td>
                    <td>{{item.CostChannelName}}</td>
                    <td>{{item.CostChannelNo}}</td>
                    <td>{{item.Sort}}</td>
                    <td>{{vueValid(item.IsValid)}}</td>
                    <td>{{item.CreateTime}}</td>
                    <td>
                        <button type="button" v-on:click="vueEditContent(item.Id)"
                                class="btn btn-success" title="编辑" value="编辑">
                            编辑<i class="fa fa-edit"></i>
                        </button>
                        <button type="button" v-on:click="vueDelContent(item.Id,0)"
                                class="btn btn-warning" title="停用" value="停用" v-if="item.IsValid==1">
                            停用<i class="fa  fa-ban"></i>
                        </button>
                        <button type="button" v-on:click="vueDelContent(item.Id,1)"
                                class="btn btn-info" title="启用" value="启用" v-if="item.IsValid==0">
                            启用<i class="fa  fa-ban"></i>
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
        <table width="100%">
            <tbody>
                <tr>
                    <td>
                        <div id="pager">
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
        <!--当前页码-->
        <input type="hidden" id="currentPageIndex" value="1">
    </div>
</div>

<!-- 模态框 -->
<div class="modal" id="detailWindow" tabindex="100"
     role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header" style="padding: 0px;">
                <button type="button" class="close" data-dismiss="modal"
                        style="margin-right: 10px;">
                    <span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <h3 class="modal-title">编辑账户信息</h3>
            </div>
            <form id="acForm">
                <div class="modal-body form-horizontal"
                     style="padding: 0px; background-color: #fff; min-height: 350px;">
                    <div class="col-md-12" style="margin-top: 25px;">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">账户名：</label>
                            <div class="col-sm-8">
                                <input autocomplete="off" type="text" v-model="model.CostChannelName" name="CostChannelName" class="form-control input-sm" placeholder="账户名" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">账号：</label>
                            <div class="col-sm-8">
                                <input autocomplete="off" type="text" v-model="model.CostChannelNo" name="CostChannelNo" class="form-control input-sm" placeholder="账号" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态：</label>
                            <div class="col-sm-8">
                                <select class="form-control input-sm"
                                        name="SpendType" v-model="model.IsValid">
                                    <option v-for="item in validTypeNum" v-bind:value="item.id">
                                        {{item.name}}
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">排序值：</label>
                            <div class="col-sm-8">
                                <input name="Sort" class="form-control input-sm"
                                       type="number" v-model="model.Sort" placeholder="排序值">
                            </div>
                        </div>
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" onclick="saveDataInfo();" class="btn btn-primary">
                        <i class="fa fa-save"></i>保存
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- 模态框end -->
@section Script
{
    <script src="@(ViewBag.RootNode)/Assets/js/PagerView.js"></script>
    <script src="@(ViewBag.RootNode)/Content/Scripts/CostNote/costchannel.js"></script>
}
